package com.shujujiegou;

/**
 * Created by Administrator on 2018/5/20/020.
 */
public class stackTest {
    private int[] arr;

    private int top;

    private int size;

    public stackTest(int size) {
        this.size = size;
        arr = new int[size];
        top = -1;
    }

    public void push(int a) {
        arr[++top] = a;
    }

    public int pop() {
        return arr[top--];
    }

    public static void main(String[] args) {
        String value = "abcd";
        char[] chars = value.toCharArray();
        StringBuffer sb = new StringBuffer();
        for (int i = chars.length - 1; i > -1; i--) {
            sb.append(chars[i]);
        }
        System.out.println(sb.toString());

        int i = 0;
        System.out.println(++i);
    }
}
